﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace MALRECrewrite.Etc
{
    class StringListToCommasConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string temp = (value as List<string>).Count > 0 ? (value as List<string>).First() : "";

            foreach (string s in (value as List<string>).Skip(1))
            {
                temp += ", " + s;
            }

            return temp;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
